package com.cloud.demo.login.start;
import java.util.Date;

import com.cloud.demo.login.bean.entity.AccountInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 类说明
 *
 * @author szj
 * @date 2021/7/20
 */
//@Component
@Slf4j
public class Start implements ApplicationRunner {
    public static final Map<String, AccountInfo> ACCOUNT_MAP = new ConcurrentHashMap<>(16);

    @Override
    public void run(ApplicationArguments args) throws Exception {
        AccountInfo accountInfo = new AccountInfo();
        accountInfo.setId(1);
        accountInfo.setCreateTime(new Date());
        accountInfo.setUpdateTime(new Date());
        accountInfo.setUserId(1);
        accountInfo.setAccountType((byte)2);
        accountInfo.setUserType((byte)0);
        accountInfo.setAccountName("xxx");
        accountInfo.setPassword("123");
        accountInfo.setIsDelete(false);
        ACCOUNT_MAP.put(accountInfo.getAccountName(), accountInfo);

    }
}
